package com.sz.biz.logistics.billing.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Function: QuotationBaseCalcObject. <br>
 * Date: 2017年04月20日 14:27 <br>
 * Author: wentao.chang
 */
public abstract class QuotationBaseCalcObject implements Serializable {
    /**
     * 使用的结算方式id
     */
    protected int settlementId;

    /**
     * 订单号码，所有的计费相关都是来源于订单
     * 订单产生服务单，服务单去计算供应商的价格
     */
    protected String orderNo;

    /**
     * 匹配到的产品id
     */
    protected int productId;
    /**
     * 匹配到的产品分组Id
     */
    protected int groupId;
    /**
     * 匹配到的产品uid
     */
    protected String productUid;
    /**
     * 匹配到的产品name
     */
    protected String productName;

    /**
     * 匹配到的产品EstimatedTime
     */
    protected BigDecimal productEstimatedTime;

    /**
     * 匹配到的产品EstimatedUnit
     */
    protected String productEstimatedUnit;


    /**
     * 订单时间
     */
    protected Date orderDate;

    /**
     * 货物类型
     */
    protected String cargoTypeCode;

    /**
     * 发件人的国家
     */
    protected String fromCountry;

    /**
     * 发件人的省份
     */
    protected String fromProvince;

    /**
     * 发件人的城市
     */
    protected String fromCity;
    /**
     * 发件人的地区
     */
    protected String fromArea;

    /**
     * 发件人的街道
     */
    protected String fromStreet;

    /**
     * 发件人的邮编
     */
    protected String fromPostcode;

    /**
     * 揽收的国家
     */
    protected String fetchCountry;

    /**
     * 揽收的省份
     */
    protected String fetchProvince;

    /**
     * 揽收的城市
     */
    protected String fetchCity;
    /**
     * 揽收的地区
     */
    protected String fetchArea;

    /**
     * 揽收的街道
     */
    protected String fetchStreet;

    /**
     * 揽收的邮编
     */
    protected String fetchPostcode;

    /**
     * 收件人的国家
     */
    protected String toCountry;

    /**
     * 收件人的省份
     */
    protected String toProvince;

    /**
     * 收件人的城市
     */
    protected String toCity;

    /**
     * 收件人的城市
     */
    protected String toArea;

    /**
     * 收件人的街道
     */
    protected String toStreet;

    /**
     * 收件人的邮编
     */
    protected String toPostcode;

    /**
     * 重量
     */
    protected BigDecimal weight;
    /**
     * 重量
     */
    protected String weightUnit;

    /**
     * 体积
     */
    protected BigDecimal volume;

    /**
     * 计算重量 max(weight,volume)
     */
    protected BigDecimal calcWeight;

    /**
     * 计算计量单位
     */
    protected String calcWeightUnit;
    /**
     * 计算信息
     */
    protected List<String> calcMsgs = new ArrayList<>();
    /**
     * 总价
     */
    private BigDecimal amount = BigDecimal.ZERO;

    private List<QuotationCalcResult> result = new ArrayList<>();
    /**
     * 是否忽略起点的运算 在无产品或者无服务时首先使用点过滤了起点，在后面就无需在过滤了
     *
     * @return
     */
    protected boolean ignoreStarts = false;

    public List<QuotationCalcResult> getResult() {
        return result;
    }

    public void setResult(List<QuotationCalcResult> result) {
        this.result = result;
    }

    public QuotationCalcResult addAndGetNewResult() {
        QuotationCalcResult currentResult = new QuotationCalcResult();
        result.add(currentResult);
        return currentResult;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public String getFromCountry() {
        return fromCountry;
    }

    public void setFromCountry(String fromCountry) {
        this.fromCountry = fromCountry;
    }

    public String getFromProvince() {
        return fromProvince;
    }

    public void setFromProvince(String fromProvince) {
        this.fromProvince = fromProvince;
    }

    public String getFromCity() {
        return fromCity;
    }

    public void setFromCity(String fromCity) {
        this.fromCity = fromCity;
    }

    public String getFromStreet() {
        return fromStreet;
    }

    public void setFromStreet(String fromStreet) {
        this.fromStreet = fromStreet;
    }

    public String getToCountry() {
        return toCountry;
    }

    public void setToCountry(String toCountry) {
        this.toCountry = toCountry;
    }

    public String getToProvince() {
        return toProvince;
    }

    public void setToProvince(String toProvince) {
        this.toProvince = toProvince;
    }

    public String getToCity() {
        return toCity;
    }

    public void setToCity(String toCity) {
        this.toCity = toCity;
    }

    public String getToStreet() {
        return toStreet;
    }

    public void setToStreet(String toStreet) {
        this.toStreet = toStreet;
    }

    public List<String> getCalcMsgs() {
        return calcMsgs;
    }

    public void setCalcMsgs(List<String> calcMsgs) {
        this.calcMsgs = calcMsgs;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public BigDecimal getVolume() {
        return volume;
    }

    public void setVolume(BigDecimal volume) {
        this.volume = volume;
    }

    public String getCargoTypeCode() {
        return cargoTypeCode;
    }

    public void setCargoTypeCode(String cargoTypeCode) {
        this.cargoTypeCode = cargoTypeCode;
    }

    public void putMsg(String msg) {
        this.getCalcMsgs().add(msg);
    }

    public void putMsgs(List<String> msgs) {
        this.getCalcMsgs().addAll(msgs);
    }

    public String getFromPostcode() {
        return fromPostcode;
    }

    public void setFromPostcode(String fromPostcode) {
        this.fromPostcode = fromPostcode;
    }

    public String getToPostcode() {
        return toPostcode;
    }

    public void setToPostcode(String toPostcode) {
        this.toPostcode = toPostcode;
    }

    public String getProductUid() {
        return productUid;
    }

    public void setProductUid(String productUid) {
        this.productUid = productUid;
    }

    public String getWeightUnit() {
        return weightUnit;
    }

    public void setWeightUnit(String weightUnit) {
        this.weightUnit = weightUnit;
    }

    public BigDecimal getCalcWeight() {
        return calcWeight;
    }

    public void setCalcWeight(BigDecimal calcWeight) {
        this.calcWeight = calcWeight;
    }

    public String getFromArea() {
        return fromArea;
    }

    public void setFromArea(String fromArea) {
        this.fromArea = fromArea;
    }

    public String getToArea() {
        return toArea;
    }

    public void setToArea(String toArea) {
        this.toArea = toArea;
    }

    public boolean isIgnoreStarts() {
        return ignoreStarts;
    }

    public void setIgnoreStarts(boolean ignoreStarts) {
        this.ignoreStarts = ignoreStarts;
    }

    public int getSettlementId() {
        return settlementId;
    }

    public void setSettlementId(int settlementId) {
        this.settlementId = settlementId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCalcWeightUnit() {
        return calcWeightUnit;
    }

    public void setCalcWeightUnit(String calcWeightUnit) {
        this.calcWeightUnit = calcWeightUnit;
    }

    public BigDecimal getProductEstimatedTime() {
        return productEstimatedTime;
    }

    public void setProductEstimatedTime(BigDecimal productEstimatedTime) {
        this.productEstimatedTime = productEstimatedTime;
    }

    public String getProductEstimatedUnit() {
        return productEstimatedUnit;
    }

    public void setProductEstimatedUnit(String productEstimatedUnit) {
        this.productEstimatedUnit = productEstimatedUnit;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public String getFetchCountry() {
        return fetchCountry;
    }

    public void setFetchCountry(String fetchCountry) {
        this.fetchCountry = fetchCountry;
    }

    public String getFetchProvince() {
        return fetchProvince;
    }

    public void setFetchProvince(String fetchProvince) {
        this.fetchProvince = fetchProvince;
    }

    public String getFetchCity() {
        return fetchCity;
    }

    public void setFetchCity(String fetchCity) {
        this.fetchCity = fetchCity;
    }

    public String getFetchArea() {
        return fetchArea;
    }

    public void setFetchArea(String fetchArea) {
        this.fetchArea = fetchArea;
    }

    public String getFetchStreet() {
        return fetchStreet;
    }

    public void setFetchStreet(String fetchStreet) {
        this.fetchStreet = fetchStreet;
    }

    public String getFetchPostcode() {
        return fetchPostcode;
    }

    public void setFetchPostcode(String fetchPostcode) {
        this.fetchPostcode = fetchPostcode;
    }
}
